package com.rzl.expense.system.service.impl;

import com.rzl.expense.common.core.text.Convert;
import com.rzl.expense.system.domain.GroupUserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzl.expense.system.mapper.GroupUserRoleMapper;
import com.rzl.expense.system.service.IGroupUserRoleService;

import java.util.List;

/**
 * 集团角色关联Service业务层处理
 * 
 * @author expense
 * @date 2024-11-05
 */
@Service
public class GroupUserRoleServiceImpl implements IGroupUserRoleService 
{
    @Autowired
    private GroupUserRoleMapper groupUserRoleMapper;

    /**
     * 查询集团角色关联
     * 
     * @param roleId 集团角色关联主键
     * @return 集团角色关联
     */
    @Override
    public GroupUserRole selectGroupUserRoleByRoleId(String roleId)
    {
        return groupUserRoleMapper.selectGroupUserRoleByRoleId(roleId);
    }

    @Override
    public List<String> selectGroupAuthId(String roleId)
    {

        return groupUserRoleMapper.selectGroupAuthId(Convert.toStrArray(roleId));
    }

    /**
     * 查询集团角色关联列表
     * 
     * @param groupUserRole 集团角色关联
     * @return 集团角色关联
     */
    @Override
    public List<GroupUserRole> selectGroupUserRoleList(GroupUserRole groupUserRole)
    {
        return groupUserRoleMapper.selectGroupUserRoleList(groupUserRole);
    }

    /**
     * 新增集团角色关联
     * 
     * @param groupUserRole 集团角色关联
     * @return 结果
     */
    @Override
    public int insertGroupUserRole(GroupUserRole groupUserRole)
    {
        return groupUserRoleMapper.insertGroupUserRole(groupUserRole);
    }

    /**
     * 修改集团角色关联
     * 
     * @param groupUserRole 集团角色关联
     * @return 结果
     */
    @Override
    public int updateGroupUserRole(GroupUserRole groupUserRole)
    {
        return groupUserRoleMapper.updateGroupUserRole(groupUserRole);
    }

    /**
     * 批量删除集团角色关联
     * 
     * @param roleIds 需要删除的集团角色关联主键
     * @return 结果
     */
    @Override
    public int deleteGroupUserRoleByRoleIds(String[] roleIds)
    {
        return groupUserRoleMapper.deleteGroupUserRoleByRoleIds(roleIds);
    }

    /**
     * 删除集团角色关联信息
     * 
     * @param roleId 集团角色关联主键
     * @return 结果
     */
    @Override
    public int deleteGroupUserRoleByRoleId(String roleId)
    {
        return groupUserRoleMapper.deleteGroupUserRoleByRoleId(roleId);
    }
}
